package com.wksc.framework.impexp.bean;

/**
 * <p>
 * BatchImportData.java
 * </p>
 * 
 * 功能描述：封装导入信息。和错误信息的类
 * 
 * @creator QinJinxue
 * @date Sep 1, 2010
 */
@SuppressWarnings("rawtypes")
public class BatchImportData implements Comparable {

	/** EXCEL一行封装的数据对象 */
	private Object pojo;

	/** 该行数据在EXCEL中的行号 */
	private int lineNum;

	/** 错误原因 */
	private String errorCause;

	public BatchImportData() {
		super();
	}

	public BatchImportData(Object pojo, int lineNum) {
		this.pojo = pojo;
		this.lineNum = lineNum;
	}

	public BatchImportData(Object pojo, int lineNum, String errorCause) {
		this.pojo = pojo;
		this.lineNum = lineNum;
		this.errorCause = errorCause;
	}

	public BatchImportData(int lineNum, String errorCause) {
		this.lineNum = lineNum;
		this.errorCause = errorCause;
	}

	public String getErrorCause() {
		return errorCause;
	}

	public void setErrorCause(String errorCause) {
		this.errorCause = errorCause;
	}

	public Object getPojo() {
		return pojo;
	}

	public void setPojo(Object pojo) {
		this.pojo = pojo;
	}

	public int getLineNum() {
		return lineNum;
	}

	public void setLineNum(int lineNum) {
		this.lineNum = lineNum;
	}

	@Override
	public int compareTo(Object o) {
		BatchImportData bd = (BatchImportData) o;
		int i = bd.getLineNum();
		return lineNum > i ? 1 : (lineNum == i ? 0 : -1);
	}
}
